#! /bin/sh /usr/share/dpatch/dpatch-run
## 06_fpc_2_2_2.dpatch by Mazen Neifer <mazen.neifer@supaero.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: This patch fixes GTK1 LCL interface compilation using FPC 2.2.2.

@DPATCH@
Index: ide/ideprocs.pp
===================================================================
--- lazarus~/ide/ideprocs.pp	(revision 12749)
+++ lazarus/ide/ideprocs.pp	(working copy)
@@ -1299,8 +1299,8 @@
 var
   S1: PChar;
   S2: PChar;
-  c1: Integer;
-  c2: Integer;
+  c1: char;
+  c2: char;
 begin
   if (Data1=nil) then begin
     if Data2=nil then begin
@@ -1315,10 +1315,10 @@
       S1:=PChar(Data1);
       S2:=PChar(Data2);
       repeat
-        c1:=Ord(S1[0]);
-        c2:=Ord(S2[0]);
-        Result:=Ord(LowerCaseTable[c1])-Ord(LowerCaseTable[c2]); //!! Must be replaced by ansi characters !!
-        if (Result<>0) or (c1=0) or (c2=0) then exit;
+        c1:=S1[0];
+        c2:=S2[0];
+        Result:=Ord(upcase(c1))-Ord(upCase(c2)); //!! Must be replaced by ansi characters !!
+        if (Result<>0) or (c1=#0) or (c2=#0) then exit;
         Inc(S1);
         Inc(S2);
       until false;
Index: lcl/interfaces/gtk/gtkproc.inc
===================================================================
--- lazarus~/lcl/interfaces/gtk/gtkproc.inc	(revision 12749)
+++ lazarus/lcl/interfaces/gtk/gtkproc.inc	(working copy)
@@ -1048,9 +1048,9 @@
 end;
 
 procedure MergeClipping(DestinationDC: TDeviceContext; DestinationGC: PGDKGC;
-  X, Y, Width, Height: integer; ClipMergeMask: PGdkPixmap;
+  X, Y, Width, Height: integer; ClipMergeMask: PGdkBitmap;
   ClipMergeMaskX, ClipMergeMaskY: integer;
-  var NewClipMask: PGdkPixmap);
+  var NewClipMask: PGdkBitmap);
 // merge ClipMergeMask into the destination clipping mask at the
 // destination rectangle
 var
